package com.codenum.codegenerator;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
* the Rxgvojqy type
*/
@SuppressWarnings("ALL")
public class Rxgvojqy {


        private static volatile Rxgvojqy instance;

        /**
        * 方法MethodMap
        */
        private Map<String, Method> methodMap = new HashMap<>(32);

        private Map<String, Object> saleTypeMap = new HashMap<>(64);

        public static Rxgvojqy getInstance() {
            if (instance == null) {
                synchronized (Rxgvojqy.class) {
                    if (instance == null) {
                        instance = new Rxgvojqy();
                    }
                }
            }
            return instance;
        }


        private Rxgvojqy() {

        }



    public  Boolean judgeRqgyqxuzhi(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeWrwavmphps(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeBundrumzbu(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeNfqnqvgyrq(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeGehzwlcifo(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeHeimjgeypb(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgePzayvvuzfp(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeLcuxssdcai(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeHztiliivzf(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeFvcgxtngpa(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeLiaypmhmfu(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeFrbcekbpfu(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }

    private String  rqgyqxuzhi;
    private String  wrwavmphps;
    private String  bundrumzbu;
    private String  nfqnqvgyrq;
    private String  gehzwlcifo;
    private String  heimjgeypb;
    private String  pzayvvuzfp;
    private String  lcuxssdcai;
    private String  hztiliivzf;
    private String  fvcgxtngpa;
    private String  liaypmhmfu;
    private String  frbcekbpfu;


    public void setRqgyqxuzhi(String rqgyqxuzhi){
    this.rqgyqxuzhi = rqgyqxuzhi;
    }

    public String getRqgyqxuzhi(){
    return this.rqgyqxuzhi;
    }
    public void setWrwavmphps(String wrwavmphps){
    this.wrwavmphps = wrwavmphps;
    }

    public String getWrwavmphps(){
    return this.wrwavmphps;
    }
    public void setBundrumzbu(String bundrumzbu){
    this.bundrumzbu = bundrumzbu;
    }

    public String getBundrumzbu(){
    return this.bundrumzbu;
    }
    public void setNfqnqvgyrq(String nfqnqvgyrq){
    this.nfqnqvgyrq = nfqnqvgyrq;
    }

    public String getNfqnqvgyrq(){
    return this.nfqnqvgyrq;
    }
    public void setGehzwlcifo(String gehzwlcifo){
    this.gehzwlcifo = gehzwlcifo;
    }

    public String getGehzwlcifo(){
    return this.gehzwlcifo;
    }
    public void setHeimjgeypb(String heimjgeypb){
    this.heimjgeypb = heimjgeypb;
    }

    public String getHeimjgeypb(){
    return this.heimjgeypb;
    }
    public void setPzayvvuzfp(String pzayvvuzfp){
    this.pzayvvuzfp = pzayvvuzfp;
    }

    public String getPzayvvuzfp(){
    return this.pzayvvuzfp;
    }
    public void setLcuxssdcai(String lcuxssdcai){
    this.lcuxssdcai = lcuxssdcai;
    }

    public String getLcuxssdcai(){
    return this.lcuxssdcai;
    }
    public void setHztiliivzf(String hztiliivzf){
    this.hztiliivzf = hztiliivzf;
    }

    public String getHztiliivzf(){
    return this.hztiliivzf;
    }
    public void setFvcgxtngpa(String fvcgxtngpa){
    this.fvcgxtngpa = fvcgxtngpa;
    }

    public String getFvcgxtngpa(){
    return this.fvcgxtngpa;
    }
    public void setLiaypmhmfu(String liaypmhmfu){
    this.liaypmhmfu = liaypmhmfu;
    }

    public String getLiaypmhmfu(){
    return this.liaypmhmfu;
    }
    public void setFrbcekbpfu(String frbcekbpfu){
    this.frbcekbpfu = frbcekbpfu;
    }

    public String getFrbcekbpfu(){
    return this.frbcekbpfu;
    }

    void setMethodMap(Map<String, Method> methodMap) {
        this.methodMap = methodMap;
    }

   void setSaleTypeMap(Map<String, Object> saleTypeMap) {
        this.saleTypeMap = saleTypeMap;
    }

    public Boolean judgeAttributeValue(String saleType, String methodName) {
        try {
            Object saleTypeObject = saleTypeMap.get(saleType);
            String targetMethod = methodName.replace("judge", "get");
            String attr = methodName.replace("judge", "");
            Method method = methodMap.get(targetMethod);
            Object invoke = method.invoke(saleTypeObject);
            return Objects.isNull(invoke) ? Boolean.FALSE : Objects.equals(invoke.toString().toLowerCase(), attr.toLowerCase());
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e.getMessage());
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e.getMessage());
        }
    }

}